<?php
$this->breadcrumbs=array(
	'Alunos'=>array('index'),
	'Gerenciar ',
);

$this->menu=array(
	array('label'=>'Listar Alunos', 'url'=>array('index')),
	array('label'=>'Novo Aluno', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('cad-aluno-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Alunos</h1>


<?php

//echo CHtml::link('Busca Avançada','#',array('class'=>'search-button')); 

?>
<div class="search-form" style="display:none">
    
<?php
//$this->renderPartial('_search',array(
//   'model'=>$model,
//)); 
?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'cad-aluno-grid',
        'pager' => array('cssFile' => Yii::app()->baseUrl . '/themes/'.Yii::app()->theme->name.'/gridView.css'),
        'cssFile' => Yii::app()->baseUrl . '/themes/'.Yii::app()->theme->name.'/css/gridView.css',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'cod_aluno',
		array(
                       'name'=>'cod_polo',
                       'type'=>'raw',
                       'value'=>'cad_polo::loadTablePolo($data->cod_polo)'
                    ),
                array(
                       'name'=>'cod_turma',
                       'type'=>'raw',
                       'value'=>'cad_turma::loadTableTurma($data->cod_turma)'
                    ),
                array(
                       'name'=>'status',
                       'type'=>'raw',
                       'value'=>'Lookup:: item("Status",$data->status)'
                     ),
		'nome',
		'cpf',
		'rg',
		/*
		'data_nascimento',
		'fili_pai',
		'fili_mae',
		'logradouro',
		'numero',
		'complemento',
		'bairro',
		'cidade',
		'estado',
		'cep',
		'tel_residencial',
		'tel_celular',
		'tel_comercial',
		'tel_recados',
		'e_mail',
		*/
		array(
			'class'=>'CButtonColumn',
		),                    
		array(  
			 'class'=>'CButtonColumn',
                         'template'=> '{Documentos}',//'<img src="'.Yii::app()->baseUrl . '/themes/'.Yii::app()->theme->name.'/imagens/bg.png">',
	                 'buttons'=>array(
	                   'Documentos'=>array(
	                   'url'=>'Yii::app()->createUrl("/cad_arq/create", array("cod_aluno" => $data->cod_aluno))',
//	                   'options'=>array( 
//	               //      'confirm'=>"CONFIRMAR PAGAMENTO?",
//	                     'ajax'=>array(
//	                        'url'=>"js:$(this).attr('href')",
//	                        'type'=>'post',
//	                        'success'=>'$.fn.yiiGridView.update(\'pessoa-modulo-grid\')',
//	               ),
//	            ),
	          ),                    
                ),
               ),             
	),
)); ?>
